VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClsSalon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public WithEvents orset As ClsRecordset
Attribute orset.VB_VarHelpID = -1

Public Event DataChanged()

Public codigo As String
Public nombre As String

Private Sub Class_Initialize()
    Set orset = New ClsRecordset
    orset.setCampos dbCampos(sal)
    orset.setTablas Array(sal)
End Sub
Private Sub Class_Terminate()
    Set orset = Nothing
End Sub
Public Sub consulta()
    orset.consulta
End Sub
Public Sub consultaNombre(optNombre As String)
    orset.consulta Array(sal_nombre & " LIKE '" & optNombre & "%'")
End Sub
Public Sub consultaDatos(codig As String)
    orset.consulta Array(sal_id & "=" & codig)
End Sub

Public Sub consultaXContrato(optContratoCod As String)
    orset.consultaGral , Array(sal, cns), _
                       Array(cns_sal_id & "=" & sal_id, _
                             cns_cnt_id & "=" & optContratoCod), _
                       Array(sal_nombre)
End Sub
Public Sub Nuevo(newNombre As String)
    orset.sInsert Array("", newNombre)
End Sub
Public Sub Modificar(codig As String, newNombre As String)
    orset.sUpdate Array(codig, newNombre)
End Sub
Public Sub Borrar(codig As String)
    orset.sDelete Array(sal_id & "=" & codig)
End Sub
Private Sub Reload_members()
    With orset
        codigo = .getDato(sal_id)
        nombre = .getDato(sal_nombre)
    End With
    RaiseEvent DataChanged
End Sub
Private Sub orset_DataChanged()
    Reload_members
End Sub
